from backend.eform.models import EformFile,EformSchema
from rest_framework.serializers import ModelSerializer
from rest_framework import serializers

# class ImteSerializer(ModelSerializer):
#     class Meta:
#         model = Imte
#         fields='__all__'

class EformFileSerializer(ModelSerializer):
    ext = serializers.ReadOnlyField()
    isImage = serializers.ReadOnlyField()
    isVideo = serializers.ReadOnlyField()
    id = serializers.ReadOnlyField()

    class Meta:
        model = EformFile
        fields = ('id','file','eform','created','user_id','ext','isImage','isVideo')
        
        
class EformSchemaSerializer(ModelSerializer):
    class Meta:
        model = EformSchema
        fields = [
            'id',
            'title',
            'formNo',
            'ref',
            'issue',
            'endorsor_require',
            'form_issue_date',
            'created',
            'updated',
            'enable',
        ]